<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Thymeleaf的入门</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<!--输出hello数据-->
<p th:text="${hello}"></p>

<table>
    <tr>
        <td>下标</td>
        <td>编号</td>
        <td>姓名</td>
        <td>住址</td>
    </tr>
    <tr th:each="user,userStat:${users}">
        <td>
            下标:<span th:text="${userStat.index}"></span>,
        </td>
        <td th:text="${user.id}"></td>
        <td th:text="${user.name}"></td>
        <td th:text="${user.address}"></td>
    </tr>
</table>

<hr />
<h3>map输出</h3>
<div th:each="map,mapStat:${dataMap}">
    map数据:<div th:text="${map}"></div>
    mapkey:<span th:text="${mapStat.current.key}"></span><br/>
    mapvalue:<span th:text="${mapStat.current.value}"></span><br/>
    ==============================================
</div>

<h3>数组输出</h3>
<div th:each="nm,nmStat:${names}">
    <span th:text="${nmStat.count}"></span><span th:text="${nm}"></span>
    ==============================================
</div>

<h3>日期格式化</h3>
<div>
    <span th:text="${#dates.format(now,'yyyy-MM-dd hh:ss:mm')}"></span>
</div>

<h3>if条件判断</h3>
<div>
    <span th:if="${sex == 0}">女</span>
</div>

<!--页面包含-->
<div id="footer" th:replace="footer::copy"></div>


</body>
</html>